package com.yangchoi.jetpackcompose.ui.widget.ext

import androidx.compose.foundation.clickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.composed

// modifier 扩展

/**
 * 点击事件,去掉modifier默认的点击背景
 */
fun Modifier.onClick(onClickAction: () -> Unit): Modifier =
    composed {
        clickable(
            indication = null,
            interactionSource = remember { MutableInteractionSource() },
            onClick = onClickAction
        )
    }